<!-- libraries ajax -->
<script type="text/javascript">
    $(document).ready(function(){
        $("#load_match").click(function(){
            $('#waiting').fadeIn('slow');
            $('#content').empty();
            $('#content').removeClass('alert alert-success');
            $('#content').removeClass('alert alert-error');
            $("#content").load("<?php echo base_url(); ?>user/load_game");
            $('#waiting').fadeOut('slow');
        });
        
        $("#load_result").click(function(){
            $('#waiting').fadeIn('slow');
            $('#content').empty();
            $('#content').removeClass('alert alert-success');
            $('#content').removeClass('alert alert-error');
            $("#content").load("<?php echo base_url(); ?>user/load_result");
            $('#waiting').fadeOut('slow');
        });
        
        $("#load_other_result").click(function(){
            $('#waiting').fadeIn('slow');
            $('#content').empty();
            $('#content').removeClass('alert alert-success');
            $('#content').removeClass('alert alert-error');
            $("#content").load("<?php echo base_url(); ?>user/positions");
            $('#waiting').fadeOut('slow');
        });
        
        $("#profile").click(function(){
            $('#waiting').fadeIn('slow');
            $('#content').empty();
            $('#content').removeClass('alert alert-success');
            $('#content').removeClass('alert alert-error');
            $("#content").load("<?php echo base_url(); ?>user/load_profile");
            $('#waiting').fadeOut('slow');
        });
        
        $("#rules").click(function(){
            $('#waiting').fadeIn('slow');
            $('#content').empty();
            $('#content').removeClass('alert alert-success');
            $('#content').removeClass('alert alert-error');
            $("#content").load("<?php echo base_url(); ?>welcome/load_rules");
            $('#waiting').fadeOut('slow');
        });
    });
    
</script>
<!-- end libraries ajax -->

<div class="well" style="min-height: 80%">
    <div class="navbar">
            <div class="navbar-inner">
              <div class="container">
                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                </a>
                <a class="brand">InDev Prode</a>
                <div class="nav-collapse">
                  <ul class="nav">
                    <li class="dropdown">
                      <a class="dropdown-toggle" data-toggle="dropdown" href="#">Mis Jugadas <b class="caret"></b></a>
                      <ul class="dropdown-menu" style="text-align: left">
                        <li><a href="#" id="load_match">Cargar / Editar</a></li>
                        <li><a href="#" id="load_result">Mis resultados</a></li>
                        <li><a href="#" id="load_other_result">Otros resultados</a></li>
                      </ul>
                    </li>
                    <!-- Reglamento -->
                    <li><a href="#" id="rules">Reglamento</a></li>
                  </ul>
            
                  <ul class="nav pull-right">
                    <li class="divider-vertical"></li>
                    <li class="dropdown">
                      <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <?php if($this->session->userdata('logged_in'))
                                  echo "Hola! ".$this->session->userdata('username');
                                  else
                                  echo "Log In";
                                ?>
                        <b class="caret"></b>
                      </a>
                      <ul class="dropdown-menu">
                        <?php if($this->session->userdata('logged_in')) { ?>
                        <li>
                            <a href="#" id="profile">Mi Perfil</a>
                        </li>
                        <?php } ?>
                        <li class="divider"></li>
                        <li>
                                <?php
                                    if($this->session->userdata('logged_in'))
                                      echo anchor('login/LogOut','Salir');
                                      else
                                      echo anchor('/','Ingresar');
                                ?>
                        </li>
                      </ul>
                    </li>
                  </ul>
                </div><!-- /.nav-collapse -->
              </div>
            </div><!-- /navbar-inner -->
          </div>
          
        <div id="content" class="well">
            
        </div>
</div>